import React from 'react'
import ReactDOM from 'react-dom'
import {
  Provider, // 封装的一个标签 在最外层的标签 可以监听组件内部的state的变化 ，就可以不用写store.subscribe
} from 'react-redux'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import store from './store/index'
import App from './view/App'
import Barrier from './view/Barrier'
import Success from './view/Success'
import Career from './view/Career'
import Singer from './view/Singer'
import Special from './view/Special'
import Login from './view/Login'

/*
  很多UI组件库按需导入需要使用babel的插件管理  步骤是：
    1. cnpm install babel-plugin-import --save
    2. cnpm run eject 
        在package.json中就会有babel的相关管理的地方  再导入组件库的插件即可
*/

ReactDOM.render(
  <Provider store={store}>
    <Router>
      <Route path="/" exact component={App}></Route>
      <Route path="/barrier" component={Barrier}></Route>
      <Route path="/career" component={Career}></Route>
      <Route path="/success" component={Success}></Route>
      <Route path="/singer" component={Singer}></Route>
      <Route path="/Special" component={Special}></Route>
      <Route path="/login" component={Login}></Route>
    </Router>
  </Provider>,
  document.getElementById('root')
)
